/*
 * atmel_45_flash.h
 *
 *  Created on: 12/03/2010
 *      Author: gustavo
 */

#ifndef BADL_ATMEL_45_FLASH_H_
#define BADL_ATMEL_45_FLASH_H_


// *********************** DEFINITIONS *************************

typedef BOOL badl_atmel_45_flash_Buffer;
#define badl_atmel_45_flash_BUFFER1	0
#define badl_atmel_45_flash_BUFFER2	1

typedef U16 badl_atmel_45_flash_Block;
typedef U16 badl_atmel_45_flash_PageAddress;
typedef U16 badl_atmel_45_flash_PageOffset;
typedef U32 badl_atmel_45_flash_DataSize;

typedef U8 badl_atmel_45_flash_Density;
#define badl_atmel_45_flash_AT45DB011D		 3
#define badl_atmel_45_flash_AT45DB021D		 5
#define badl_atmel_45_flash_AT45DB041D		 7
#define badl_atmel_45_flash_AT45DB081D		 9
#define badl_atmel_45_flash_AT45DB161D		11
#define badl_atmel_45_flash_AT45DB321D		13
#define badl_atmel_45_flash_AT45DB642D		15

typedef BOOL badl_atmel_45_flash_PageSize;
#define badl_atmel_45_flash_PAGE_SIZE_264	0
#define badl_atmel_45_flash_PAGE_SIZE_256	1

#define badl_atmel_45_flash_NUMBER_OF_PAGES_PER_BLOCK	8

typedef struct {
	badl_atmel_45_flash_PageSize pageSize : 1;
	BOOL protect : 1;
	badl_atmel_45_flash_Density density : 4;
	BOOL compare : 1;
	BOOL notBusy : 1;
} badl_atmel_45_flash_Status;

// *********************** PROTOTYPES **************************


#endif /* BADL_ATMEL_45_FLASH_H_ */
